package cn.lili.controller.system;

import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.system.entity.dos.ResponseLog;
import cn.lili.modules.system.service.ResponseLogService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 *
 * @author pyy
 * @Description:第三方日志调用
 * @since 2023/11/2
 */
@Slf4j
@RestController
@RequestMapping("/system/responseLog")
@Api(tags = "第三方请求日志")
@RequiredArgsConstructor
public class ResponseLogController {

    private final ResponseLogService responseLogService;

    @ApiOperation(value = "分页获取")
    @GetMapping(value = "/page")
    public ResultMessage<Page<ResponseLog>> page(PageVO pageVO) {
        return ResultUtil.data(responseLogService.getPage(pageVO));
    }

    @ApiOperation(value = "获取参数信息")
    @GetMapping(value = "/getById")
    public ResultMessage<Object> getById(Long id) {
        return ResultUtil.data(responseLogService.getById(id));
    }

    @ApiOperation(value = "修改参数信息")
    @PostMapping(value = "/editJsonParam")
    public ResultMessage<Object> editJsonParam(@RequestBody ResponseLog responseLog) {
        return ResultUtil.data(responseLogService.editJsonParam(responseLog));
    }
    @ApiOperation(value = "重发请求  请求方式为：输入")
    @PostMapping(value = "/responseSend/{id}")
    public ResultMessage<Object> responseSend(@PathVariable Long id) {
        return ResultUtil.data(responseLogService.resposeSend(id));
    }

}

